/*
 * @Description: 
 * @Version: 2.0
 * @Author: 
 * @Date: 2022-04-02 11:47:35
 * @LastEditors: cxc
 * @LastEditTime: 2022-04-06 15:49:11
 */
import React, { useState } from 'react'
import { Row, Col, Modal } from 'antd';
import UserConTitle from '../user/UserConTitle';
import EmployeeData from '../user/EmployeeData';
import DetailedPermissions from '../user/DetailedPermissions';
import ManagerScope from '../user/ManagerScope';


export default function UserModal(props) {
  const { title, visible, onOk, onCancel, icon, content } = props
  //0-员工资料，1-详细权限，2-管理范围
  const [checkRole, setCheckRole] = useState(0)
  function handleCheck(data) {
    setCheckRole(data)
  }
  return (
    <>
      {/* 对话框 */}
      <Modal
        className='role_auth'
        destroyOnClose='true'
        cancelText='关闭'
        okText='确定'
        centered='true'
        title={title}
        visible={visible}
        onOk={onOk}
        onCancel={onCancel} >
        <Row >
          {/* 标题 */}
          <Col span={24}>
            <UserConTitle handleCheck={handleCheck} />
          </Col>
          {/* 内容 */}
          <Col span={24}>
            {checkRole === 0 ? <EmployeeData /> : (checkRole === 1 ? <DetailedPermissions /> : <ManagerScope />)}
          </Col>
        </Row>
      </Modal>
    </>
  )
}
